<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>head</title>
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
	<script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>	
    <!-- <link rel="stylesheet" href="./assets/css/bootstrap.min.css">
	<script src="./assets/js/jquery.min.js"></script>
	<script src="./assets/js/bootstrap.min.js"></script> -->

</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  <a class="navbar-brand" href="#">
	 <img width="180px" src="assets\schoolname.png" alt="schoolname">
	 <span style="margin-left:10px;font-size:1.5rem">学生互助平台</span>
	 </a>

  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav">
      <li class="nav-item ">
        <a class="nav-link" href="index.php">主页</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="list.php">学生来帮忙</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="market.php">二手市场</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="activity.php">活动</a>
      </li>
    </ul>
  </div>
	<form class="form-inline my-2 my-lg-0" action="list.php">
    <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="key">
    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
  </form>
	<div style="margin-left:20px">
	<?php
	session_start();
	
	if(isset($_SESSION["username"])){
	?>
	  <span style="color: #ffffff;">欢迎&nbsp</span>
		<span><a href="user.php?user=<?php echo $_SESSION["username"] ?>" style="color: #ffffff;text-decoration:none;"><?php echo $_SESSION["username"]?></a></span>  	
		<span>&nbsp&nbsp</span>
		<span><a href="logout.php" style="color: #ffffff;text-decoration:none;">注销</a></span>	  	
	<?php
	}
	else{
	?>
		<span><a href="#" data-toggle="modal" data-target="#login" style="color: #ffffff;text-decoration:none;">登录</a></span>  	
		<span>&nbsp&nbsp</span>
		<span><a href="#" data-toggle="modal" data-target="#reg" style="color: #ffffff;text-decoration:none;">注册</a></span>	
	<?php
	}
	?>
	</div>
</nav>    
</body>
</html>
<div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
		  <div class="modal-header">
			<h5 class="modal-title" id="myModalLabel">注册</h5>
		    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>		    
		  </div>
		      <div class="modal-body">
					

		        <form class="form-horizontal" action="doUserReg.php" method="post" enctype="multipart/form-data">
		          <div class="form-group row">
								<label for="inputname" class="col-md-2 col-form-label">用户名:</label>
								<div class="col-md-10">
									<input type="text" class="form-control" id="inputName" name="username" placeholder="用户名">
								</div>	
		          </div>

		          <div class="form-group row">
		            <label for="inputPassword" class="col-md-2 col-form-label">密&nbsp&nbsp&nbsp码:</label>
		            <div class="col-md-10">
		              <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码">
		            </div>
		          </div>
		    
		          <div class="form-group row">
		            <label  class="col-md-2 col-form-label">性&nbsp&nbsp&nbsp别:</label>
		            <div class="col-md-6">
		              <label class="checkbox-inline">
		             <input type="radio" id="inlineRadio1" value="0" name="gender" checked> 男
		            </label>
		            <label class="checkbox-inline">
		              <input type="radio"  id="inlineRadio" value="1" name="gender" > 女
		            </label>
		        </div>
		          </div>

		          <div class="form-group row">
		            <label for="inputBirthdate" class="col-md-2 col-form-label">生&nbsp&nbsp&nbsp日:</label>
		            <div class="col-md-10">
		              <input type="date" class="form-control" id="inputBirthdate" name="birthdate">
		            </div>
		          </div>


		          <div class="form-group row">
		            <label for="inputBirthdate" class="col-md-2 col-form-label">头&nbsp&nbsp&nbsp像:</label>
		            <div class="col-md-10">
		              <input type="file" name="pic"  id="inputP">
		            </div>
		          </div>

		          <div class="form-group row">
		            <label for="inputEmail" class="col-md-2 col-form-label">邮&nbsp&nbsp&nbsp箱:</label>
		            <div class="col-md-10">
		            	<input type="email" class="form-control" id="inputEmail" name="mail" placeholder="邮箱">
		            </div>
		          </div>
		          <div class="form-group row">
		            <div class="col-md-offset-2 col-md-10">
		                <input type="submit" value="注册" class="btn btn-default">
		                <input  type="reset" value="重置" class="btn btn-default">
		            </div>
		          </div>
		        </form>
		    </div>
		    </div>
		  </div>
		</div>  
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="login" aria-hidden="true">
	<div class="modal-dialog modal-dialog-centered" role="document">
	  <div class="modal-content">
	    <div class="modal-header">
				<h5 class="modal-title" id="login">登录</h5>
	      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>		        
	    </div>
	    <div class="modal-body">
			<form class="form-horizontal" id="loginForm" action="doUserLog.php" method="post">
			  <div class="form-group">
			    <!-- <label for="inputUsername" class="col-md-4 control-label">用户名：</label> -->
			    <div class="col-md-12">
			      <input type="text" class="form-control" id="inputUsername" name="username" placeholder="用户名">
			    </div>
			  </div>
			  <div class="form-group">
			    <!-- <label for="inputPassword3" class="col-md-4 control-label">密码：</label> -->
			    <div class="col-md-12">
			      <input type="password" class="form-control" id="inputPassword3" name="password" placeholder="密码">
			    </div>
			  </div>
			  		<!-- 	  start -->
			  <div class="form-group">
			      <div class="col-sm-offset-1 col-sm-13">
			       <a href="admin/index.php" style="float: right;">admin>></a>
			    </div>
			  </div>
			<!--     end -->

			  <div class="form-group">
			    <div class="col-sm-offset-2 col-sm-10">
			      <button id="loginBtn" type="submit" class="btn btn-default">登录</button>
			    </div>
			  </div>
			</form>
	    </div>
	  </div>
	</div>
</div>  
<script>
</script>
